package cn.krund.lyc.hotlerobot.activity.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.krund.lyc.hotlerobot.R;
import cn.krund.lyc.hotlerobot.activity.base.BaseActivity;
import cn.krund.lyc.hotlerobot.utils.DeviceIdUtil;
import cn.krund.lyc.hotlerobot.utils.MD5Util;

/**
 * @包名: cn.krund.lyc.hotlerobot.activity.ui
 * @作者: 刘育成
 * @时间: 2018/3/30  10:01
 * @org: 克路德人工智能
 * @描述: TODO
 * @fileName: SettingActivity
 */

public class SettingActivity extends BaseActivity implements View.OnClickListener {

    @BindView(R.id.iv_mapping)
    ImageView mIvMapping;
    @BindView(R.id.iv_map_manage)
    ImageView mIvMapManage;
    @BindView(R.id.tv_back)
    TextView mTvBack;
    @BindView(R.id.tv_title)
    TextView mTvTitle;
    @BindView(R.id.tv_id)
    TextView mTvId;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_setting;
    }

    @Override
    protected void initView() {
        mTvTitle.setText("设置");
        mTvId.setText(MD5Util.MD5(DeviceIdUtil.getLocalMacAddressFromBusybox()));
    }

    @Override
    protected void initNev() {
        mIvMapping.setOnClickListener(this);
        mIvMapManage.setOnClickListener(this);
        mTvBack.setOnClickListener(this);

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_mapping:
                openActivity(MappingPatternActivity.class);
                break;
            case R.id.iv_map_manage:
                openActivity(MapManageActivity.class);
                break;
            case R.id.tv_back:
                finish();
                break;
        }
    }
}
